package com.yh.csx.crm.dao;

import com.yh.csx.crm.po.Customer;
import com.yh.csx.crm.qo.CustomerListQo;
import com.yh.csx.crm.qo.CustomerPri2PubQo;
import com.yh.csx.crm.qo.CustomerQo;
import com.yh.csx.crm.qo.SimpleCustomerQo;
import com.yh.csx.crm.vo.CustomerDetailVo;
import com.yh.csx.crm.vo.CustomerInfoVo;
import com.yh.csx.crm.vo.CustomerPri2PubVO;
import com.yh.csx.crm.vo.CustomerSimpleVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface CustomerMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Customer record);

    int insertSelective(Customer record);

    Customer selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Customer record);

    int updateByPrimaryKeyWithBLOBs(Customer record);

    int updateByPrimaryKey(Customer record);

    List<Customer> selectBySalesUserId(Long salesUserId);

    int countBySalesUserId(Long salesUserId);

    List<Customer> selectByExample(CustomerListQo qo);

    int selectCountByCustomerName(@Param("customerName") String customerName, @Param("customerId") Long customerId);

    /**
     * 客户名称模糊查询
     * @param customerName
     * @return
     */
    List<String> selectLikeByCustomerName(String customerName);

    /**
     * 查询客户信息列表
     *
     * @param qo
     * @return
     */
    List<CustomerInfoVo> selectCustomerInfoList(CustomerQo qo);

    /**
     * 查询客户简单信息
     *
     * @return
     */
    List<CustomerSimpleVo> selectCustomerSimpleList(SimpleCustomerQo qo);

    /**
     * 查询客户详情
     *
     * @param id
     * @return
     */
    CustomerDetailVo selectCustomerDetail(@Param("id") Long id);

    List<Customer> selectCustomeNot(@Param("userId") Long userId,@Param("customerStatus1")String customerStatus1,@Param("customerStatus2")String customerStatus2);

    Customer selectBycustomerNumber(Customer customer);

    //List<String> seleallgetAllCompanyCode(String userId);

    Customer selectComp(String customerName);

    List<Customer> selectAllSynchronized();

    BigDecimal selectProvinceAllLimit(@Param("salesProvince") String salesProvince);

    List<Customer> selectAll();

    List<String> selectCustomerNumberByUserIds(@Param("userIds") List<Long> userIds);

    List<String> selectProvinceCodeByUserIds(@Param("userIds") List<Long> userIds);

    List<CustomerPri2PubVO> selectPub2PriCust(CustomerPri2PubQo customerPri2PubQo);
}